﻿using System;

namespace RoomyDungeonGenerator
{
	public static class ExtensionMethods
	{
		/// <summary>Prints the tiles of the map as a multiline string for testing/debugging purposes.</summary>
		public static string ToDisplayString(this Tile[,] map)
		{
			string result = string.Empty;
			for (int j = 0; j < map.GetLength(1); j++)
			{
				for (int i = 0; i < map.GetLength(0); i++)
				{
					if (map[i, j].Type == TileTypes.Void)
						result += "0";
					else if (map[i, j].Type == TileTypes.Floor)
						result += " ";
					else
						result += "1";
				}
				result += Environment.NewLine;
			}
			return result;
		}
	}
}
